package com.ruoyi.ring.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.ring.mapper.RingBannerMapper;
import com.ruoyi.ring.domain.RingBanner;
import com.ruoyi.ring.service.IRingBannerService;

/**
 * bannerService业务层处理
 * 
 * @author liuwp
 * @date 2025-07-29
 */
@Service
public class RingBannerServiceImpl implements IRingBannerService 
{
    @Autowired
    private RingBannerMapper ringBannerMapper;

    /**
     * 查询banner
     * 
     * @param id banner主键
     * @return banner
     */
    @Override
    public RingBanner selectRingBannerById(Long id)
    {
        return ringBannerMapper.selectRingBannerById(id);
    }

    /**
     * 查询banner列表
     * 
     * @param ringBanner banner
     * @return banner
     */
    @Override
    public List<RingBanner> selectRingBannerList(RingBanner ringBanner)
    {
        return ringBannerMapper.selectRingBannerList(ringBanner);
    }

    /**
     * 根据业务主键查询一条记录：banner
     *
     * @param ringBanner banner
     * @return banner
     */
    @Override
    public RingBanner selectOneRingBanner(RingBanner ringBanner)
    {
        return ringBannerMapper.selectOneRingBanner(ringBanner);
    }

    /**
     * 新增banner
     * 
     * @param ringBanner banner
     * @return 结果
     */
    @Override
    public int insertRingBanner(RingBanner ringBanner)
    {
        ringBanner.setCreateTime(DateUtils.getNowDate());
        return ringBannerMapper.insertRingBanner(ringBanner);
    }

    /**
     * 修改banner
     * 
     * @param ringBanner banner
     * @return 结果
     */
    @Override
    public int updateRingBanner(RingBanner ringBanner)
    {
        ringBanner.setUpdateTime(DateUtils.getNowDate());
        return ringBannerMapper.updateRingBanner(ringBanner);
    }

    @Override
    public int updateRingBannerCondition(RingBanner ringBanner, RingBanner ringBannerCondition)
    {
                ringBanner.setUpdateTime(DateUtils.getNowDate());
        return ringBannerMapper.updateRingBannerCondition(ringBanner, ringBannerCondition);
    }

    /**
     * 批量删除banner
     * 
     * @param ids 需要删除的banner主键
     * @return 结果
     */
    @Override
    public int deleteRingBannerByIds(Long[] ids)
    {
        return ringBannerMapper.deleteRingBannerByIds(ids);
    }

    /**
     * 删除banner信息
     * 
     * @param id banner主键
     * @return 结果
     */
    @Override
    public int deleteRingBannerById(Long id)
    {
        return ringBannerMapper.deleteRingBannerById(id);
    }

    /**
     * 条件删除banner
     *
     * @param ringBanner banner
     * @return 结果
     */
    @Override
    public int deleteRingBannerByCondition(RingBanner ringBanner)
    {
        return ringBannerMapper.deleteRingBannerByCondition(ringBanner);
    }

}
